/**
 * Ref https://blog.csdn.net/chase_hung/article/details/82284788
 */

// Qt
#include <QLabel>
#include <QPushButton>
#include <QQuickItem>
#include <QQuickWidget>

// my
#include "MyWindow.h"

MyWindow::MyWindow(QWidget* parent)
    : QWidget(parent)
    , m_pQuickWidget(nullptr) {

    // this->setWindowFlags(Qt::FramelessWindowHint);
    this->setAttribute(Qt::WA_TranslucentBackground);
    this->resize(800, 600);

    // add widget
    addQuickWidget();
}
//---------------------------------
MyWindow::~MyWindow() {
}
//---------------------------------
void MyWindow::addQuickWidget() {
    m_pQuickWidget = new QQuickWidget(this);

    m_pQuickWidget->move(0, 0);
    m_pQuickWidget->setSource(QUrl("qrc:/kevin/MyMain.qml"));
    m_pQuickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);

    m_pQuickWidget->resize(width(), height());
    m_pQuickWidget->show();
}
